﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MVC4.Controllers
{
    public class HomeController : Controller
    {
        //
        // GET: /Home/

        public ActionResult Index()
        {
            ViewBag.Test = "index";
            return View();
        }

        [AllowAnonymous]
        [HttpPost]
        public ActionResult Login(FormCollection form)
        {
            return Json(new { status = true, msg = form["user"] + "|" + form["pass"] });
        }

        [AllowAnonymous]
        public JsonResult Register(FormCollection form)
        {
            return Json(new { status = true, msg = form["user"] + "|" + form["pass"] }, JsonRequestBehavior.AllowGet);
        }
    }
}
